﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Douban.Api.Infrastructure
{
    public interface IDataSourcePool
    {
        T GetDataSource<T>(string sourceId) where T : IDataSource;
        
        /// <summary>
        /// Provide IDataSource
        /// </summary>
        /// <param name="originType">
        ///     the object original type. 
        ///     e.g. If you want to get InboxDataSource that provide Inbox class data source, 
        ///          you should using typeof(Inbox)
        /// </param>
        /// <returns></returns>
        IDataSource GetDataSource(string sourceId, Type originType);
    }
}
